package the.broccoli.auth;

public class UserContext {
    private UserContext() {}

    public static SessionUser getSessionUser() {
        return AuthUtils.getSessionUser() == null ? new SessionUser() : (SessionUser) AuthUtils.getSessionUser();
    }

    public static Integer tenantId() {
        return getSessionUser().getTenantId();
    }

    public static String userId() {
        return getSessionUser().getUserId();
    }

    public static String openId() {
        return getSessionUser().getOpenId();
    }

    public static String userName() {
        return getSessionUser().getUserName();
    }

    public static String customerCode() {
        return getSessionUser().getCustomerCode();
    }
}
